package bairui.international.console.web.controller.authority.authorization.group;

import java.util.Arrays;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lianjing.sh.spring.web.controller.base.action.Action;
import com.lianjing.sh.spring.web.controller.enhance.output.FomatOutput;

import bairui.international.service.Service_Group;


/**
 * @generated
 *
 * C_Authority_Authorization_Group_Authority_ActionRemove
 *
 */
@Controller
public class C_Authority_Authorization_Group_Authority_ActionRemove
 extends SC_Authority_Authorization_Group_Authority_ActionRemove 
{
	
	@Autowired @Lazy private Service_Group service_Group;

	/**
	 * 移除权限Action
	 */
	@Action(ActionRemove.class)
	@PutMapping(ActionRemove.RequestMappingValue)
	public @FomatOutput @ResponseBody Object removeAction(
		ModelMap map, HttpServletRequest request, 
		@PathVariable(name=ActionRemove.PathVariableName.GroupId) long groupId,
		Long[] actionsId
	) throws Exception {
		if(null != actionsId && actionsId.length>0){
			service_Group.removeAuthorities(groupId, Arrays.asList(actionsId));
		}
		return null;
	}
	

}


